package homework;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class number1 {
public static void main(String[] args) {
	//创建集合并添加字符串
	ArrayList<String> arr = new ArrayList<>();
	Collections.addAll(arr, "张三,21", "李四,24", "丁真,26", "珍珠,27", "锐刻五,30");
	//创建map存储结果
	HashMap<String, Integer> map = new HashMap<>();
	
	for(String s:arr) {
		//分割集合成数组
		String[] spiltarr = s.split(","); 
		if(Integer.parseInt(spiltarr[1])>24) {
			map.put(spiltarr[0],Integer.parseInt(spiltarr[1]));
		}
	}
	System.out.println(map);
}
}
